<?
$c = new SoapClient('http://localhost:8080/webservice/services/HelloService?wsdl');
echo "start it >>><br>";


$obj = $c->sayHello(array('name'=>'jammy', 'age'=>'30','tel'=>'123456'));


$dom = new DOMDocument();
$dom->loadXML($obj->out);
print_r(getArray($dom->documentElement));


function getArray($node) {
  $array = false;

  if ($node->hasAttributes()) {
    foreach ($node->attributes as $attr) {
      $array[$attr->nodeName] = $attr->nodeValue;
    }
  }

  if ($node->hasChildNodes()) {
    if ($node->childNodes->length == 1) {
      $array[$node->firstChild->nodeName] = getArray($node->firstChild);
    } else {
      foreach ($node->childNodes as $childNode) {
      if ($childNode->nodeType != XML_TEXT_NODE) {
        $array[$childNode->nodeName][] = getArray($childNode);
      }
    }
  }
  } else {
    return $node->nodeValue;
  }
  return $array;
}
?>